<html>

<head>
    <title>es6-Study</title>
    <meta http-equiv="cache-control" content="max-age=0" />
    <meta http-equiv="cache-control" content="no-cache" />
    <meta http-equiv="expires" content="0" />
    <meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
    <meta http-equiv="pragma" content="no-cache" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="shortcut icon" href="../../favicon.ico">
    <link rel="stylesheet" href="/lib/prettify/prettify.css">
    <script src="/lib/prettify/prettify.js"></script>
</head>

<body>
    <div>
        <a href="/">去index页</a>
        <a href="/list/list.html">去list页</a>
    </div>
    <div class="title">es6-Study</div>
    <div class="test"></div>
    <pre>
var a = [];
for (var i = 0; i < 10; i++) {
  a[i] = function () {
    console.log(i);
  };
}
a[6](); // 10</pre>
    <pre>
var a = [];
for (var i = 0; i < 10; i++) {
    a[i] = (function(i) {
        return function() {
            console.log(i);
        }
    })(i);
}
a[6](); // 6</pre>
    <pre>
var a = [];
for (let i = 0; i < 10; i++) {
    a[i] = function() {
        console.log(i);
    };
}
a[6](); // 6</pre>
    <script src="http://apps.bdimg.com/libs/jquery/1.2.3/jquery.min.js"></script>
</body>

</html>
